-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowed usage of custom AuthToken based on knox.AbstractAuthToken #275
Conversation
Hi @belugame , @James1345 I can imagine how busy you must be, I also would really appreciate it if you could have a look on the PR and give feedback... Thanks. |
@Khalidm98 hey, sorry, but i m not using or maintaining this library since years. I think it is the time to make a fork and you being the new admin. |
@belugame Thanks for your reply. But I think adding this feature will be of great help to many users of this package. And it is just a slight added feature, so in my opinion it should be added to your original repo not a fork of mine. Here are some related issues and also PRs that I found related to this feature: Thanks guys... |
Hi @Khalidm98 P.S. @belugame Is it possible to set you so people don't tag you any more? do you want me to do that? |
@James1345 it would be good, but I don't think it is possible. People see that I did the releases/merges in the past, so they tag me :P |
@James1345 thanks for your response, really appreciate it. |
Can anyone provide an example of how to use this feature. I can't for the life of me get this working. |
app_label.models:
settings:
|
I have tried creating a new class based off that abstract class and I get errors like this: ERRORS: EDIT: These were errors from last night. Revisited things today and I got it working. |
Glad it worked ✌️ |
@Khalidm98 I'm trying to use your changes (which are very cool BTW). Based on these docs: https://docs.djangoproject.com/en/4.2/topics/db/models/#abstract-related-name once we extend the AbstractAuthToken these clashes are expected. I see auth.py & view.py are using the auth_token_set accessor. We need a way to make this dynamic to use the correct accessor.
|
@geemang2022 thanks for your feedback, |
any plan for a new realse which contains this? |
Here is my solution for adding extra fields: Define a new Model that has a OneToOneField to the original AuthToken model, and add your extra fields in this new model:
you can look up these extra fields given a token |
…zzband#275) * Allowed usage of custom AuthToken based on knox.AbstractAuthToken * moved get_token_model() to models, updated the docs Co-authored-by: Khalidm98 <[email protected]>
…zzband#275) * Allowed usage of custom AuthToken based on knox.AbstractAuthToken * moved get_token_model() to models, updated the docs Co-authored-by: Khalidm98 <[email protected]>
…zzband#275) * Allowed usage of custom AuthToken based on knox.AbstractAuthToken * moved get_token_model() to models, updated the docs Co-authored-by: Khalidm98 <[email protected]>
Hi guys,
I really love this package and I regularly use it in projects that require token authentication.
I recently came across a situation in which I needed to support multiple profiles for the user in a multi-platform project. So, it is required to link the token with both the user profile and the platform client. Hence, I came up with this solution and I hope that it would be of good use to the package users.
Please, inform me if there is any unclear change and point out any change that needs further modifications.
Thanks.